package com.exam.controller;

import com.exam.pojo.Admin;
import com.exam.service.AdminService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
public class AdminController {
    @Resource
    private AdminService adminService;
    @GetMapping("/admin/{account}")
    public Admin findByAccount(@PathVariable("account")String account){
        return adminService.queryByAccount(account);
    }
    @PutMapping("/admin/update")
    public int update(@RequestBody Admin admin){
        return adminService.updateByUserId(admin);
    }
}
